using System.ComponentModel.DataAnnotations;

namespace SG3L_RAG.Application.DTOs.Auth
{
    /// <summary>
    /// 注册请求DTO
    /// </summary>
    public class RegisterDto
    {
        [Required(ErrorMessage = "用户名不能为空")]
        [MinLength(3, ErrorMessage = "用户名至少3个字符")]
        [MaxLength(50, ErrorMessage = "用户名不能超过50个字符")]
        public string Username { get; set; } = string.Empty;

        [Required(ErrorMessage = "密码不能为空")]
        [MinLength(6, ErrorMessage = "密码至少6个字符")]
        public string Password { get; set; } = string.Empty;

        [Required(ErrorMessage = "邮箱不能为空")]
        [EmailAddress(ErrorMessage = "邮箱格式不正确")]
        public string Email { get; set; } = string.Empty;

        [Phone(ErrorMessage = "手机号格式不正确")]
        public string? PhoneNumber { get; set; }

        public string Role { get; set; } = "user";
    }
}
